var mChannelData = {
	typeList:[
		{id:1,name:'HD TV'},
		{id:2,name:'LOCAL CH'},
		{id:3,name:'INTERNATIONAL'},
	
	],
	channelList:[
		{id:1,typeId:1,name:'Luxe TV HD',icon:'images/luxe.jpg',playUrl:'http://192.168.55.90:8081/'},
		{id:2,typeId:3,name:'Euro News',icon:'images/euronews.jpg',playUrl:'http://192.168.55.90:8082/'},
		{id:3,typeId:3,name:'NHK',icon:'images/nhk.jpg',playUrl:'http://192.168.55.90:8083/'},
		{id:4,typeId:3,name:'Al Manar',icon:'images/almanar.jpg',playUrl:'http://192.168.55.90:8084/'},
		{id:5,typeId:3,name:'RAI',icon:'images/rai.jpg',playUrl:'http://192.168.55.90:8085/'},
		{id:6,typeId:3,name:'FRANCE 24',icon:'images/france24.jpg',playUrl:'http://192.168.55.90:8086/'},
		{id:7,typeId:2,name:'METRO TV',icon:'images/metro.jpg',playUrl:'http://192.168.55.90:8087/'},
		{id:8,typeId:2,name:'ANTV',icon:'images/antv.jpg',playUrl:'http://192.168.55.90:8088/'},
		{id:9,typeId:2,name:'TRANS 7',icon:'images/trans7.jpg',playUrl:'http://192.168.55.90:8089/'},
		{id:10,typeId:2,name:'TRANS TV',icon:'images/transtv.jpg',playUrl:'http://192.168.55.90:8090/'},
		{id:11,typeId:1,name:'Demo',icon:'images/transtv.jpg',playUrl:'http://biz.vsdn.tv380.com/playlive.php?5B63686E5D445830303030303034317C333130307C317C313030307C54545A582E54567C687474707C74735B2F63686E5DVSDNSOOONERCOM00'}
	]
}


var typeList=new Array(),gDataList ;
function initData(callback){
	for(var i = 0;i<mChannelData.channelList.length;i++){
		var ch = mChannelData.channelList[i];
		ch.displayId = i + 1;
	}
	gDataList = mChannelData.channelList;
	typeList = mChannelData.typeList;
	
	for(var i = 0;i<typeList.length;i++){
		var type = typeList[i];
		var list = new Array();
		for(var j = 0;j<mChannelData.channelList.length;j++){
			var ch = mChannelData.channelList[j];
			if(ch.typeId == type.id){
				list.push(ch);
			}
		}
		type.dataList = list;
	}
	typeList.unshift({
		id:0,
		name:'all',
		dataList:mChannelData.channelList,
	});
	
	callback();
}


function descByNumber(a,b){
	return a.displayId > b.displayId;
}

function descByAlphabetic(a,b){
	
	return a.name>b.name;
}
